
package ch.hearc.meteo.imp.use.local;

import ch.hearc.meteo.imp.afficheur.real.JFrameStationMeteoLocal;
import ch.hearc.meteo.spec.meteo.exception.MeteoServiceException;

public class UseMeteoServiceAffichageGui
	{

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	public static void main(String[] args) throws MeteoServiceException
		{
		JFrameStationMeteoLocal.getInstance();
		main();
		}

	public static void main() throws MeteoServiceException
		{
//		String portName = "COM1";
//		String titre = RmiTools.getLocalHost() + " " + portName;
//
//		MeteoService_I meteoService = MeteoServiceFactory.create(portName);
//
//		MeteoServiceWrapper_I meteoServiceWrapperForRemoteAccess = new MeteoServiceWrapper(meteoService);
//
//		AffichageOptions affichageOptions = new AffichageOptions(3, titre);
//		final AfficheurService_I afficheurService = AfficheurFactory.create(affichageOptions, meteoServiceWrapperForRemoteAccess);
//
//		meteoService.connect();
//
//		// Liason entre les deux services d'affichage : MeteoService_I et AfficheurService_I
//		meteoService.addMeteoListener(new MeteoAdapter()
//			{
//
//				@Override
//				public void temperaturePerformed(MeteoEvent event)
//					{
//					try
//						{
//						afficheurService.printTemperature(event);
//						afficheurService.printAltitude(event);
//						afficheurService.printPression(event);
//						}
//					catch (RemoteException e)
//						{
//						e.printStackTrace();
//						}
//					}
//
//			});
//
//		MeteoServiceOptions meteoServiceOptions = new MeteoServiceOptions(800, 1000, 1200);
//		meteoService.start(meteoServiceOptions);
//
//		JFrameStationMeteo.getInstance().addMeteoServiceWrapper(meteoServiceWrapperForRemoteAccess, (AfficheurService)afficheurService);
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	}
